package com.suncky.example.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.suncky.example.R;
import com.suncky.example.databinding.ItemStringListBinding;
import com.suncky.frame.base.adapter.RecyclerViewAdapter;
import com.suncky.frame.base.adapter.RecyclerViewBindingAdapter;
import com.suncky.frame.base.adapter.holder.RecyclerViewBindingHolder;
import com.suncky.frame.base.adapter.holder.RecyclerViewHolder;

import java.util.List;

public class StringRecyclerViewBindingAdapter extends RecyclerViewBindingAdapter<String, ItemStringListBinding> {
    public StringRecyclerViewBindingAdapter(Context context, List<String> data) {
        super(context, data);
    }

    @Override
    public ItemStringListBinding onCreateDataBinding(@NonNull LayoutInflater inflater, ViewGroup parent, int viewType) {
        return ItemStringListBinding.inflate(inflater,parent,false);
    }

    @Override
    public void convert(RecyclerViewBindingHolder<ItemStringListBinding> holder, String item, int position) {
        holder.getBinding().setContent(item);
    }

}
